package io.renren.modules.collecting.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.renren.modules.collecting.entity.CollectingDeviceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 采集设备
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2024-06-27 13:12:13
 */
@Mapper
public interface CollectingDeviceDao extends BaseMapper<CollectingDeviceEntity> {

    //设备列表
    IPage<CollectingDeviceEntity> getList(IPage<CollectingDeviceEntity> query, @Param("name") String name);

    List<CollectingDeviceEntity> getBindList(List<Integer> ids);

    //根据空间id获取设备集合
    List<CollectingDeviceEntity> getDeviceList(Integer spaceId);

    //将绑定id清空
    void updateSpaceBind(Integer spaceId);

    //修改设备状态
    void updateState(@Param("deviceState") String deviceState, @Param("deviceIds") Set<Integer> deviceIds);

    //根据空间名称查询设备id集合
    List<Integer> getDeviceIds(String spaceName);

    CollectingDeviceEntity get(Integer id);

}
